class DateConverter {
  static toShangHaiTime(utcTime: string) {
    // 必须 + Z 才表示 UTC 时间
    const utcDate = new Date(utcTime + "Z");

    const formatter = new Intl.DateTimeFormat("zh-CN", {
      timeZone: "Asia/Shanghai",
      year: "numeric",
      month: "2-digit",
      day: "2-digit",
      hour: "2-digit",
      minute: "2-digit",
      second: "2-digit"
    });
    const shanghaiTime = formatter.format(utcDate);

    return shanghaiTime;
  }
}

export { DateConverter };
